//底部操作
var exports = {};

var element = null;

var panel = $(".designerOperIconRelate");

exports.init = function() {
	panel.find(".operIconRelate").on("mouseover", function(){
		$(this).find(".movePreLayerPrompt").show();
	});
	panel.find(".operIconRelate").on("mouseleave", function(){
		$(this).find(".movePreLayerPrompt").hide();
	});
	
	panel.find(".operIconRelate").on("click", function(){
		if(!element) return;
		var translate = $(this).find(".movePreLayerPrompt").data("translate");
		switch (translate){
			case "move_up":
				element.uplayer();
				break;
			case "move_down":
				element.downlayer();
				break;
			case "center_horizontally":
				element.centerHorizontally();
				break;
			case "xuanzhuan_45":
				element.rotation();
				break;
			case "fuzhi":
				element.copy();
				break;
			case 'max_v':
				element.toMax("v");
				break;
			case 'max_h':
				element.toMax("h");
				break;
			case 'max_vh':
				element.toMax();
				break;
			default:
				break;
		}
	});
}

exports.bind = function($ele) {
	element = $ele;
}

exports.unbind = function() {
	element = null;
}

module.exports = exports;